package com.titanrise.crm.environment.ioc;

/**
 * @Description:
 * @Author: pront
 * @Time:2024-11-04 12:40
 */
public class SingletonPoolUtil {

    /**
     * 从单例池中获取对象
     *
     * @param clazz 类名.class
     * @param <T>   泛型
     * @return 对象
     */
    public static <T> T getBean(Class<T> clazz) {
        SingletonConfig.initSingletonPool("com.titanrise.crm");
        return SingletonConfig.getBean(clazz);
    }

    public static Object getBean(String name) {
        SingletonConfig.initSingletonPool("com.titanrise.crm");
        return SingletonConfig.getBean(name);
    }
}
